package com.xxl.job.executor.service.jobhandler;

import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import groovy.util.logging.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Random;

/**
 * @Author fanchunshuai
 * @Description
 * @Date 2023/2/23
 * @Version 1.0
 */
@Component
@Slf4j
public class ExeXxlJob {

    /**
     * 1、简单任务示例（Bean模式）
     */
    @XxlJob("exeJobHandler")
    public void demoJobHandler() throws Exception {
        //("XXL-JOB, Hello World.");

        Random random = new Random();
        Thread.sleep(random.nextInt(100));
    }
}
